Optical processing apparatus and operating method thereof

ABSTRACT

An optical processing apparatus and a light source luminance adjustment method adapted to detect a rotational displacement and a pressing state are provided. The optical processing apparatus includes a light source unit, a processing unit, and an image sensing unit, wherein the processing unit is electrically connected to the light source unit and the image sensing unit. The light source unit provides a beam of light. The processing unit defines a frame rate, defines a plurality of time instants within a time interval, and sets the light source unit to a luminance value at each of the time instants. A length of the time interval is shorter than the reciprocal of the frame rate. The luminance values are different and are within a range. The image sensing unit captures an image by an exposure time length at each of the time instants, wherein the exposure time lengths are the same.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application is a continuation-in-part application of U.S. patentapplication Ser. No. 16/260,317 filed on, Jan. 29, 2019, which is acontinuation application of U.S. patent application Ser. No. 15/417,728filed on, Jan. 27, 2017, which is a continuation-in-part application ofU.S. patent application Ser. No. 15/240,120 filed on, Aug. 18, 2016, andthe entire contents of which are incorporated herein by reference. TheSer. No. 15/240,120 application is a divisional application of U.S.patent application Ser. No. 13/959,225, filed on Aug. 5, 2013, and theentire contents of which are incorporated herein by reference. The Ser.No. 13/959,225 application claimed the benefit of the date of theearlier filed Taiwan Patent Application No. 102104112 filed on Feb. 4,2013, priority to which is also claimed herein, and the contents ofwhich are also incorporated by reference herein. This application isalso a continuation-in-part application of U.S. patent application Ser.No. 15/939,523 filed on, Mar. 29, 2018. The Ser. No. 15/939,523application claimed the benefit of the date of the earlier filed TaiwanPatent Application No. 106142281, filed on Dec. 1, 2017, priority towhich is also claimed herein, and the contents of which are alsoincorporated by reference herein.

BACKGROUND OF THE INVENTION Field of the Invention

The present invention relates to an optical processing apparatus, alight source luminance adjustment method, and a non-transitory computerreadable medium thereof. More particularly, the present inventionrelates to an optical processing apparatus, a light source luminanceadjustment method, and a non-transitory computer readable medium thereofthat can adjust the luminance settings of a light source according tothe image quality.

Descriptions of the Related Art

With the development of science and technologies, optical touch controltechnologies have gradually found application in various fields.Accordingly, various kinds of optical processing apparatuses such asoptical navigation apparatuses, optical touch panels, and the like, havebeen developed.

In conventional optical processing apparatuses, a light source unit isused to project a beam of light onto a reflective surface. An image iscaptured by an image sensing unit so that a processing unit can executesubsequent operations according to the captured image. For example, ifthe optical processing apparatus is an optical navigation apparatus, aprocessing unit thereof compares the images that are consecutivelycaptured to determine the amount of displacement of the opticalnavigation apparatus within a time interval. Then, a cursor displayed onthe screen is controlled according to the amount of displacement fornavigation purposes. As can be seen from this, the result of theprocessing unit is determined by the quality of the images captured bythe image sensing unit. For example, for some optical processingapparatuses, images that are too bright or too dark will have an adverseeffect on the result of the subsequent determination and be consideredto have poor quality.

One conventional optical processing apparatuses has improved theaforesaid problem by adjusting the exposure time length used to captureimages. Specifically, the exposure time length used to capture thesubsequent image will be reduced when the captured image is too bright.Conversely, the exposure time length used to capture the subsequentimage will be extended when the captured image is too dark. However,when this practice is adopted, the frame rate of the optical processingapparatus will be limited if the exposure time length becomes too long.

Another conventional optical processing apparatuses that has improvedthe aforesaid problem adjusts the gain value of the programmable gainamplifier (PGA). Specifically, the gain value used to capture thesubsequent image will be reduced when the captured image is too bright.Conversely, the gain value used to capture the subsequent image will beincreased when the captured image is too dark. However, too great a gainvalue will cause too many noises in the image, which undesirably makesthe image quality poorer instead.

Accordingly, it is important to provide a technology capable ofadjusting the settings of an optical processing apparatus according tothe quality of the captured image. In case of poor image quality, theoptical processing apparatus can still adjust the settings to make thequality of the subsequent captured images desirable. In this way, theoptical processing apparatus or other apparatuses that are used with theoptical processing apparatus can use an image that has a desirablequality for subsequent determinations and operations.

SUMMARY OF THE INVENTION

To improve the aforesaid problems, the present invention provides anoptical processing apparatus, a light source luminance adjustmentmethod, and a non-transitory computer readable medium thereof.

The present disclosure provides an optical processing apparatusincluding a light source, a processor and an image sensor. The lightsource is configured to provide a beam of light to go through a throughhole of a rotary shaft to a surface of a rotary part of a button togenerate a reflected light beam reflected from the surface of the rotarypart of the button. The processor is electrically connected to the lightsource and configured to define a frame capturing period, define aplurality of first time instants within a first time interval within theframe capturing period, and set the beam of light provided by the lightsource to a luminance value at each of the first time instants, whereinthe luminance values are different corresponding to different first timeinstants and within a first range. The image sensor is electricallyconnected to the processor, and configured to capture the reflectedlight beam to output a first image of the surface of the rotary part ofthe button by an exposure time length at each of the first timeinstants. The processor is further configured to calculate an imagequality index of each of the first images, compare the image qualityindex of one of the first images with at least one first press thresholdto identify a pressing state of the button within the first timeinterval, compare the image quality indices of each of the first imageswith at least one quality threshold, select more than one of the firstimages as a plurality of first temporary images to calculate arotational displacement of the button when the image quality indices donot meet the at least one quality threshold, and when identifying thatthe pressing state of the button is between press and non-press bycomparing the image quality index with the at least one first pressthreshold, take the rotational displacement calculated between the pressand the non-press as undesired movement and not output the calculatedrotational displacement.

The present disclosure further provides an operating method of anoptical processing apparatus which includes a light source, a processorand an image sensor. The light source provides a beam of light to gothrough a through hole of a rotary shaft to a surface of a rotary partof a button to generate a reflected light beam reflected from thesurface of the rotary part of the button. The processor defines a framecapturing period, the image sensor receiving the reflected light beam.The operating method includes the steps of: defining, by the processor,a plurality of first time instants within a first time interval withinthe frame capturing period; setting, by the processor, the beam of lightprovided by the light source to a luminance value at each of the firsttime instants, wherein the luminance values are different correspondingto different first time instants and within a first range; capturing, bythe image sensor, the reflected light beam to output a first image ofthe surface of the button by an exposure time length at each of thefirst time instants; calculating, by the processor, an image qualityindex of each of the first images; comparing, by the processor, theimage quality index of one of the first images with at least one firstpress threshold to identify a pressing state of the button within thefirst time interval, comparing, by the processor, the image qualityindices of each of the first images with at least one quality threshold;selecting, by the processor, more than one of the first images as aplurality of first temporary images to calculate a rotationaldisplacement of the button when the image quality indices do not meetthe at least one quality threshold; and stop outputting the calculatedrotational displacement when the pressing state of the button isidentified between press and non-press by comparing the image qualityindex with the at least one first press threshold.

The present disclosure provides an optical processing apparatusincluding a light source, a processor and an image sensor. The lightsource is configured to provide a beam of light to go through a throughhole of a rotary shaft to a surface of a rotary part of a button togenerate a reflected light beam reflected from the surface of the rotarypart of the button. The processor is electrically connected to the lightsource and configured to define successive frame capturing periods,define a plurality of time instants within a time interval in each framecapturing period, and set the beam of light provided by the light sourceto a luminance value at each of the plurality of time instants withineach time interval. The image sensor is electrically connected to theprocessor, and configured to capture the reflected light beam to outputan image of the surface of the button by an exposure time length and again value at each of the plurality of time instants within the eachtime interval. The processor is further configured to set an imagecapture parameter, which includes at least one of the luminance value,the exposure time length and the gain value, at each of the plurality oftime instants to be different and within a predetermined range,calculate an image quality index of each of the images captured withinthe each time interval, compare the image quality index of a first imageamong the images captured within the each time interval with at leastone press threshold to identify a pressing state of the button withinthe each time interval, wherein the first image corresponds to a minimumimage capture parameter or a maximum image capture parameter among theplurality of time instants within the each time interval, calculate arotational displacement of the button using a second image among theimages captured within the each time interval, wherein the second imageis one of the images, among the plurality of time instants within theeach time interval, whose image quality index meet at least one qualitythreshold, and stop outputting the calculated rotational displacementwhen the pressing state of the button is identified between press andnon-press by comparing the image quality index with the at least onepress threshold.

As can be seen from the above descriptions, the present inventiondefines a plurality of time instants within a time interval (the lengthof this time interval is shorter than the reciprocal of the frame rateof the optical processing apparatus). At different time instants, thelight source unit is set to different luminance values and the imagesensing unit captures an image by the same exposure time length. Inother words, the present invention captures multiple images bycontrolling the luminance of the light source unit. With this mechanism,the present invention can further provide a wide variety of operationmodes. For example, the present invention may further determine theimage qualities of these images and select at least one of the imageswhich has an optimal or preferable image quality as an imagerepresenting this time interval. As another example, the presentinvention may also take the light source luminance value, which is usedto capture the image with an optimal or preferable image quality, of thelight source unit as a basic luminance value of the light source unitwithin the next time interval so that subsequent captured will havedesirable qualities.

The detailed technology and preferred embodiments implemented for thesubject invention are described in the following paragraphs accompanyingthe appended drawings for people skilled in this field to wellappreciate the features of the claimed invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a schematic view depicting an optical processing apparatus 1according to the first embodiment;

FIG. 1B is a schematic view depicting relationships between framecapturing periods, time intervals and images; and

FIGS. 2A, 2B and 2C are flowchart diagrams depicting the secondembodiment.

FIG. 3 is an operational schematic diagram of an optical processingapparatus in the first and second embodiments of the present disclosure.

FIG. 4 is an application embodiment of an optical processing apparatusaccording to a third embodiment of the present disclosure.

FIG. 5 is a block diagram of an optical processing apparatus accordingto the third embodiment of the present disclosure.

FIG. 6 is an operational schematic diagram of an optical processingapparatus according to the third embodiment of the present disclosure.

FIGS. 7A and 7B are schematic diagrams of the press/non-press states ofa button.

FIGS. 8A and 8B are other schematic diagrams of the press/non-pressstates of a button.

FIG. 9 is a flowchart diagrams depicting the third embodiment of thepresent disclosure.

FIG. 10 is an application embodiment of an optical processing apparatusaccording to another embodiment of the present disclosure.

FIG. 11 is a cross sectional view of an optical structure according toanother embodiment of the present disclosure.

FIG. 12 is another embodiment of the present disclosure which hasmultiple rotatable elements.

FIG. 13 is another embodiment of the present disclosure, in whichmultiple through holes are formed at different positions of a rotatableelement.

FIG. 14 is a cross sectional view of an optical structure according toanother embodiment of the present disclosure.

FIG. 15 is a cross sectional view of an optical structure according toanother embodiment of the present disclosure.

DESCRIPTION OF THE PREFERRED EMBODIMENT

In the following description, the optical processing apparatus, thelight source luminance adjustment method, and the non-transitorycomputer readable medium thereof according to the present invention willbe explained with reference to embodiments thereof. However, theseembodiments are not intended to limit the present invention to anyspecific environment, applications, or particular implementationsdescribed in these embodiments. Therefore, the description of theseembodiments is only for the purpose of illustration rather thanlimitation. It should be appreciated that elements unrelated to thepresent invention are omitted from depiction in the followingembodiments and the attached drawings.

The first embodiment of the present invention is an optical processingapparatus 1, a schematic view of which is depicted in FIG. 1A. Theoptical processing apparatus 1 comprises a light source unit 11, aprocessing unit 13, and an image sensing unit 15. The processing unit 13is electrically connected to the light source unit 11 and the imagesensing unit 15.

The light source unit 11 may be a light emitting diode (LED) or someother light source units well-known to those of ordinary skill in theart. The processing unit 13 may be of any various processors, centralprocessing units (CPUs), microprocessors, or other computing deviceswell-known to those of ordinary skill in the art. The image sensing unit15 may be a complementary metal oxide semiconductor (CMOS) light sensingunit or an image sensing unit well-known to those of ordinary skill inthe art.

When the optical processing apparatus 1 is powered on, the light sourceunit 11 generates a beam of light (not shown) of identifiable spectrum,while the processing unit 13 and the image sensing unit 15 performoperations provided by the present invention.

In this embodiment, the processing unit 13 defines a frame rate f. Theframe rate f is the reciprocal of the frame capturing periods T1, T2 asshown in FIG. 1B. The time lengths of the frame capturing periods T1 andT2 are the same. It is noted that the frame capturing periods T1 and T2being denoted as different reference symbols are only for indicatingthat they correspond to different frame capturing periods. Theprocessing unit 13 defines a time interval t1 within the frame capturingperiod T1 and defines a plurality of time instants t11, t12, and t13within the time interval t1. The time length of the time interval t1 isshorter than the time length of the frame capturing period T1. In otherwords, the time length of the time interval t1 is shorter than thereciprocal of the frame rate f.

The processing unit 13 sets the light beam provided by the light sourceunit 11 to a luminance value at each of the time instants t11, t12, andt13. It should be appreciated that the light beam of the light sourceunit 11 is set to different luminance values at each of the timeinstants t11, t12, and t13. The luminance values are within a firstrange. A specific example will now be described for illustration. It isassumed that the light source unit 11 has ten selectable differentlevels of luminance values and three levels (i.e., level 4 to level 6)of them are within the default range. When the optical processingapparatus 1 is powered on, the first range may be set to the defaultrange. The light source luminance values set for the light source unit11 at the time instants t11, t12, and t13 are respectively on level 4,level 5, and level 6 of the first range.

On the other hand, the image sensing unit 15 captures images 12 a, 12 b,and 12 c respectively by the exposure time length at each of the timeinstants t11, t12, and t13. The exposure time lengths used to capturethe images 12 a, 12 b, and 12 c are the same. The above specific exampleis continued for illustration. The light source luminance value of thelight source unit 11 is on level 4 at the time instant t11. The imagesensing unit 15 captures the image 12 a at this time instant.

Subsequently, the processing unit 13 calculates the image quality indexof each of the images 12 a, 12 b, and 12 c. The image quality index ofeach of the images 12 a, 12 b, and 12 c may be a feature value (e.g.,the number of pairs of bright and dark spots) and a luminance value (orreferred to image intensity) of the corresponding image or otherinformation value which can be used to determine the image quality. Theprocessing unit 13 further derives a comparison result by comparing theimage quality indices of the images 12 a, 12 b, and 12 c with at leastone threshold, i.e. at least one quality threshold.

For example, when the image quality index is a feature value of theimage, a higher image quality index represents a better image quality.In such a case, the processing unit 13 may derive the comparison resultby comparing the image quality indices of the images 12 a, 12 b, and 12c with a threshold. The comparison result may indicate which images haveimage quality indices higher than the threshold and the sequence ofthose images.

As another example, when the image quality index is the luminance valueor image intensity (e.g., an averaged luminance value or averaged imageintensity), image quality indices falling within a luminance value range(i.e., values between an upper threshold and lower threshold) representgood image qualities, whereas image quality indices that are too high(higher than the upper threshold) or too low (lower than the lowerthreshold) represent bad image qualities. In such a case, the processingunit 13 may derive the comparison result by comparing the image qualityindices of the images 12 a, 12 b, and 12 c with the two thresholds (i.e.the upper and lower thresholds). This comparison result may indicatewhich images have image quality indices between the two thresholds.

No matter what kind of information the image is used as the imagequality index, the aforesaid comparison results can be classified intotwo categories. One category is that at least a part of the imagequality indices meet the requirements (i.e., at least a part of theimages 12 a, 12 b, and 12 c meeting the at least one quality thresholdto have good image qualities), while the other category is that none ofthe image quality indices meets the requirements (i.e., the images 12 a,12 b, and 12 c all failing to meet the at least one quality threshold tohave bad image qualities). In the following description, the method inwhich the processing unit 13 subsequently determines the first selectedimage representing the time interval t1 and determines the second rangeof light source luminance values used by the light source unit 11 withinthe time interval t2 of the next frame capturing period T2 will bedescribed with respect to each of the two classes respectively.

Now, the first class (i.e., the case in which at least a part of theimage quality indices meet the requirement) will be described firstly.The processing unit 13 selects one of the images 12 a, 12 b, and 12 c asa first selected image (e.g., the image 12 c) representing the timeinterval t1 according to the comparison result. The first selected imagecan be considered as the image representing the frame capturing periodT1. In particular, the processing unit 13 selects the image representedby one of the image quality indices that meet the requirement as thefirst selected image according to the comparison result. In the casethat the image quality index is the feature value, the processing unit13 selects the image represented by any one of the image quality indicesthat are higher than the threshold as the first selected image. In thecase that the image quality index is the luminance value of the image,the processing unit 13 selects the image represented by any one of theimage quality indices ranging between the upper threshold and the lowerthreshold as the first selected image. In one embodiment, the selectedfirst image representing the frame capturing period T1 is used tocalculate displacement of the optical processing apparatus 1 withrespect to a reflective surface.

If the optical processing apparatus 1 continuous operating, theprocessing unit 13 defines a time interval t2 within the frame capturingperiod T2 immediately after the frame capturing period T1. The timeinterval t2 occurs later than the time interval t1. Furthermore, thetime length of the aforesaid time interval t2 is shorter than the timelength of the frame capturing period T2. In other words, the time lengthof the time interval t2 is shorter than the reciprocal of the frame ratef.

The processing unit 13 sets a basic luminance value of the time intervalt2 to the luminance value corresponding to the first selected image anddetermines a second range according to this basic luminance value. Forexample, the second range may comprise the basic luminance value as wellas luminance values of one (or more) previous level and one (or more)subsequent level. Assuming that the first selected image is the image 12c and the image 12 c is captured under conditions that the light sourceluminance value of the light source unit 11 is on level 6, then thebasic luminance value of the time interval t2 is on level 6 while thesecond range ranges are between level 5 to level 7.

Subsequently, the second class (i.e., the case in which none of theimage quality indices meets the requirement) will be described. Sincethe comparison result indicates that none of the image quality indicesmeets the requirement, the processing unit 13 selects more than one ofthe images 12 a, 12 b and 12 c as a plurality of first temporary imagesaccording to this comparison result. Then, the processing unit 13derives an averaged image by averaging the first temporary images andsets the averaged image as the first selected image representing thetime interval t1. The first selected image can also be considered as theimage representing the frame capturing period T1. Similarly, theselected first image representing the frame capturing period T1 is usedto calculate displacement of the optical processing apparatus 1 withrespect to a reflective surface.

Similarly, if the optical processing apparatus 1 continuous operating,the processing unit 13 defines the time interval t2 within the framecapturing period T2 immediately after the frame capturing period T1. Thetime interval t2 occurs later than the time interval t1. Furthermore,the time length of the aforesaid time interval t2 is shorter than thetime length of the frame capturing period T2. In other words, the timelength of the aforesaid time interval t2 is shorter than the reciprocalof the frame rate f.

In such a case, the processing unit 13 determines the second range ofthe light source luminance value to be set for the light source unit 11within the time interval t2. Since none of the image quality indices ofthe images 12 a, 12 b and 12 c meets the requirement, the processingunit 13 adjusts the second range on the basis of the first range. Forexample, if the image quality index is the luminance value of the imageand all of the image quality indices are lower than the lower threshold(i.e., the images 12 a, 12 b and 12 c are too dark), the processing unit13 may adjust each luminance value level within the first range to behigher by a predetermined number of levels and use the adjustedluminance value levels as the second range (e.g., when the first rangeis between level 4 to level 6, the second range may be set from level 6to level 8), or may add one more level to the luminance value levelscontained in the first range (e.g., when the first range is betweenlevel 4 to level 6, the second range may be set from level 4 to level7). In the case that the image quality index is the luminance value ofthe image and all of the image quality indices are higher than the upperthreshold, a reverse process can be performed. In the case that theimage quality index is the feature value of the image and all of theimage quality indices are lower than the lower threshold, the processingunit 13 may also adjust each luminance value level within the firstrange to be higher with a predetermined number of levels. In addition,the adjusted luminance value levels may be used as the second range, ormay add one more level to the luminance levels contained in the firstrange.

After the processing unit 13 has determined the second range of thelight source luminance value to be used by the light source unit 11within the time interval t2 of the next frame capturing period T2, asubsequent operation will be described next.

The processing unit 13 defines a plurality of time instants t21, t22 andt23 within the time interval t2. It should be appreciated that thenumber of time instants defined within the time interval t2 is the sameas the number of the light source luminance value levels within thesecond range. Subsequently, the processing unit 13 sets the light beamprovided by the light source unit 11 to a luminance value at each of thetime instants t21, t22 and t23. It should be appreciated that the lightsource luminance values set for the light source unit 11 at each of thetime instants t21, t22 and t23 are different and are within the secondrange. On the other hand, the image sensing unit 15 captures images 14a, 14 b and 14 c respectively by the same exposure time length at eachof the time instants t21, t22 and t23.

Similarly, the processing unit 13 then calculates the image qualityindex of each of the images 14 a, 14 b and 14 c. The image quality indexof each of the images 14 a, 14 b and 14 c may be the feature value,luminance value (or referred to image intensity) of the correspondingimage or other informational value that can be used to determine theimage quality. The processing unit 13 further derives a comparisonresult by comparing the image quality indices of the images 14 a, 14 band 14 c with at least one threshold. Afterwards, the processing unit 13further selects a second selected image representing the time intervalt2 according to the comparison result. For example, the processing unit13 selects one of the images 14 a, 14 b and 14 c as a second selectedimage (e.g., the image 14 b) representing the time interval t2, or setsan averaged image of the images 14 a, 14 b and 14 c as the secondselected image. The second selected image can also be considered as theimage representing the frame capturing period T2. In one embodiment, theselected second image representing the frame capturing period T2 is usedto calculate displacement of the optical processing apparatus 1 withrespect to a reflective surface, e.g., by comparing the selected firstimage representing the frame capturing period T1 and the selected secondimage representing the frame capturing period T2. If the opticalprocessing apparatus 1 continuous operating, operations similar to whathas been described above can be repeated.

It should be appreciated that in this embodiment, the lengths of thetime intervals defined by the processing unit 13 within different framecapturing periods are not necessarily the same as long as the lengths ofthe time intervals are shorter than the frame capturing periods (i.e.,the reciprocal of the frame rate). Furthermore, the numbers of timeinstants defined by the processing unit 13 within different timeintervals are not necessarily the same. In other words, the numbers ofimages captured by the image sensing unit 15 within different timeintervals are not necessarily the same. For example, when imagescaptured within the time intervals of a certain frame capturing periodall have good qualities, it can be expected that images to be capturedby the image sensing unit 15 within the next frame capturing period willalso have good image qualities. Then the processing unit 13 may definefewer time instants within the time intervals of the next framecapturing period to decrease the number of images to be captured by theimage sensing unit 15. With such a configuration, the resources consumedby the optical processing apparatus 1 can be duly reduced.

As can be seen from the above descriptions, the optical processingapparatus 1 defines a time interval within each frame capturing period,captures multiple images with different light source luminance valueswithin this time interval, and further calculates the image qualityindex of each image. When at least a part of the images have goodqualities, the optical processing apparatus 1 selects an image with goodimage quality as the image representing this time interval, e.g., forcalculating displacement. The light source luminance value, which isused to capture the image with good image quality, is then set as thebasic luminance value to be used by the light source unit within thenext frame capturing period. When all of the images have bad qualities,the optical processing apparatus selects the averaged image of theseimages as the image representing this time interval, e.g., forcalculating displacement, and duly adjusts the range of the light sourceluminance values to be used within the next frame capturing period.Since the range of the luminance values to be used by the light sourceunit within the next frame capturing period is adjusted based on theimage qualities, it can be expected that images to be captured by theimage sensing unit 15 within the next frame capturing period will havepreferable image qualities.

Furthermore, since the optical processing apparatus 1 adjusts the lightsource luminance value of the light source unit instead of adjusting theexposure time length used to capture images or adjusting the gain valueof a programmable gain amplifier, the optical processing apparatus 1does not have the shortcomings of the prior art.

The second embodiment of the present invention is a light sourceluminance adjustment method, a flowchart diagram of which is depicted inFIGS. 2A, 2B and 2C. The light source luminance adjustment method isadapted for use in an optical processing apparatus (e.g., the opticalprocessing apparatus 1 of the first embodiment). The optical processingapparatus comprises a light source unit, an image sensing unit, and aprocessing unit. The light source unit provides a beam of light, whilethe processing unit defines a frame rate.

The light source luminance adjustment method first executes step S201 todefine, by the processing unit, a time interval within a frame capturingperiod. Subsequently, step S203 is executed to define, by the processingunit, a plurality of time instants within the time interval, with thetime length of the time interval being shorter than the reciprocal ofthe frame rate.

Then, step S205 is executed to set, by the processing unit, the lightsource unit to a luminance value and to capture, by the image sensingunit, an image by an exposure time length at each of the time instants.It should be appreciated that the luminance values set at different timeinstants are different and are within a range. Furthermore, the exposuretime lengths used to capture images at different time instants are thesame. Subsequently, step S207 is executed to calculate, by theprocessing unit, an image quality index of each of the images. Then,step S209 is executed to derive, by the processing unit, a comparisonresult by comparing the image quality indices with at least onethreshold.

Subsequently, step S211 is executed to determine whether at least a partof the image quality indices meet the requirement (i.e., whether atleast a part of the images captured in step S205 have good imagequalities) according to the comparison result. If the answer is “yes”,step S213 is executed to select, by the processing unit, one of theimages as a selected image representing the time interval according tothe comparison result. More particularly, in step S213, the imagecorresponding to the image quality index that meets the requirement isselected as the selected image.

Then, step S215 is executed to determine, by the processing unit,whether to process the next frame capturing period. If the answer is“yes”, step S217 is executed to set, by the processing unit, a basicluminance value of a time interval of the next frame capturing period tothe luminance value corresponding to the selected image. Subsequently,step S219 is executed to determine, by the processing unit, anotherrange of light source luminance values according to the basic luminancevalue. Then, step S201 is executed again. If the determination result ofstep S215 is no, the light source luminance adjustment method isfinished.

If the determination result of step S211 is no (i.e., none of the imagequality indices meets the requirement, or in other words, imagescaptured in step S205 all have bad image qualities), step S221 isexecuted.

In step S221, the processing unit selects more than one of the images asa plurality of first temporary images according to the comparisonresult. More particularly, the processing unit may select all of theimages as the temporary images. Subsequently, in step S223, theprocessing unit derives an averaged image by averaging the temporaryimages and sets the averaged image as the selected image representingthe time interval.

Then, step S225 is executed to determine, by the processing unit,whether to process the next frame capturing period. If the answer is“yes”, step S277 is executed to determine, by the processing unit, therange of a time interval of the next frame capturing period according tothe comparison result. It should be appreciated that the rangedetermined in step S227 is associated with the light source luminancevalue to be used by the light source unit within the time interval ofthe next frame capturing period. Furthermore, the range determined instep S227 is different from that in step S205. Then, step S201 isexecuted again. On the other hand, if the determination result of stepS225 is no, the light source luminance adjustment method is finished.

In addition to the aforesaid steps, the second embodiment can alsoexecute all the operations and functions set forth in the firstembodiment. The method in which the second embodiment executes theseoperations and functions will be readily appreciated by those ofordinary skill in the art based on the explanation of the firstembodiment, and thus, will not be further described herein.

Moreover, the light source luminance adjustment method described in thesecond embodiment may be implemented by a non-transitory computerreadable medium. The non-transitory computer readable medium has acomputer program stored therein. The computer program executes the lightsource luminance adjustment method described in the second embodimentafter being loaded into an optical processing apparatus. The computerprogram may be a file that can be transmitted through a network, or maybe stored in a tangible machine-readable medium, such as a read onlymemory (ROM), a flash memory, a floppy disk, a hard disk, a compactdisk, a mobile disk, a magnetic tape, a database accessible to networks,or any other storage media with the same function and well known tothose skilled in the art.

According to the above descriptions and FIG. 3, FIG. 3 is an operationalschematic diagram of an optical processing apparatus 1 in the first andsecond embodiments of the present disclosure. For example, FIG. 3 showsthat the optical processing apparatus 1 is operated on a high reflectivesurface during Frames 1 and 2, and moves to a lower reflective surfaceduring Frame 3, and is operated on a super low reflective surface duringFrames 4 to 6. The present invention defines a time interval (e.g.,t1˜t6) within each frame capturing period (e.g., T1˜T6), capturesmultiple images (e.g., 12 a˜12 c, 14 a˜14 c in FIG. 1B) with differentlight source luminance values (e.g., levels L1˜L3) within this timeinterval, and further calculates the image quality index of each of themultiple images. When at least a part of the multiple images have goodqualities, one of the images with a good image quality (e.g., the firstimage in Frames 1 and 2; the second image in Frame 3; the third image inFrames 4 to 6) is selected as the image representing this time interval,e.g., for calculating displacement. The light source luminance valueused to capture the image with good image quality is set as the basicluminance value to be used by the light source unit within the nextframe capturing period. When all of the images have bad image qualities,an averaged image of the images is set as the image representing thistime interval, e.g., for calculating displacement, and a range of lightsource luminance values to be used within the next frame capturingperiod is duly adjusted. Since the range of luminance values to be usedby the light source unit within the next frame capturing period isadjusted based on the image qualities of a current frame capturingperiod, it can be expected that images to be captured within the nextframe capturing period will have preferable image qualities. Moreover,since the first and second embodiments adjust the light source luminanceof the light source unit instead of adjusting the exposure time lengthused to capture images or adjusting the gain value of the programmablegain amplifier, they do not have the shortcomings of the prior art.

It should be mentioned that if all of the images captured in said nextframe capturing period also have bad image qualities (e.g., out of asuitable range as shown in FIG. 3), the range of luminance values iscontinuously adjusted based on the image qualities of the imagescaptured in said next frame capturing period till at least one of theimages have good quality. Preferably, the image quality of at least oneof the images captured in one frame capturing period is adjusted to bewithin the suitable range. The suitable range is determined according tothe resolution and noise tolerance of the optical processing apparatus.

As mentioned above, said image representing one time interval may beused to calculate a displacement of the optical processing apparatuswith respect to a reflective surface.

In one embodiment, the optical processing apparatus of the presentdisclosure is adapted to detect a pressing state and a rotationaldisplacement of a button, such as a watch crown.

Referring to FIG. 4, it is an application embodiment of an opticalprocessing apparatus 1′ according to a third embodiment of the presentdisclosure in which the optical processing apparatus 1′ is adapted todetect a pressing state and a rotational displacement of a watch crown40. In FIG. 4, the watch crown 40 is shown to include a rotary shaft 41,a rotary part 43, and a connection part 45 for connecting the rotaryshaft 41 and the rotary part 43. The function and structure of a watchcrown is known to the art and thus details thereof are not describedtherein. It should be mentioned that although FIG. 4 takes a watch crown40 as an example for illustrating a button, the present disclosure isnot limited thereto. The button may be other types having a properstructure as long as it can be pushed/pulled and rotated by a user, andhas a surface to be illuminated and captured by the optical processingapparatus 1′.

Referring to FIG. 5 together, FIG. 5 is a block diagram of an opticalprocessing apparatus 1′ according to the third embodiment of the presentdisclosure. The optical processing apparatus 1′ includes a processingunit 13′, the light source unit 11 and the image sensing unit 15. Inthis embodiment, the processing unit 13′ further includes a displacementcalculator 131 and the press/non-press detector 133. Similar to theabove first and second embodiments, the processing unit 13′ is a CPU,MCU or ASIC and preferably includes at least one memory device, e.g., avolatile memory and/or a nonvolatile memory, such that operations of thedisplacement calculator 131 and the press/non-press detector 133 areimplemented by hardware codes and/or software codes operating inconjunction with the memory device. It should be mentioned that althoughFIG. 5 shows the displacement calculator 131 and the press/non-pressdetector 133 with different functional blocks, it is only intended toillustrate but not to limit the present disclosure. Operations of boththe displacement calculator 131 and the press/non-press detector 133 areconsidered to be performed by the processing unit 13′.

In the third embodiment of the present disclosure, the displacementcalculator 131, the light source unit 11 and the image sensing unit 15performs similar operations as the optical processing apparatus 1 of thefirst and second embodiments, i.e., the displacement calculator 131performing the operations of the processing unit 13 of the first andsecond embodiments. Operations of the light source unit 11 and the imagesensing unit 15 controlled by the displacement calculator 131 in thethird embodiment are similar to those in the first and secondembodiments, and thus details thereof are not repeated herein.

Referring to FIG. 6, it is an operational schematic diagram of anoptical processing apparatus 1′ according to the third embodiment of thepresent disclosure. Referring to FIGS. 4-6 together, the light sourceunit 11 is also used to provide a beam of light to a reflective surface,wherein the reflective surface in this embodiment is a surface (e.g., abottom surface 41S of the rotary shaft 41) of the button (e.g., a watchcrown 40 in FIG. 4) facing the light source unit 11. It is appreciatedthat it is possible to arrange the light source unit 11 to opposite toanother surface of the rotary shaft 41 instead of the bottom surface41S.

Similarly, the displacement calculator 131 (or the processing unit 13′)is electrically connected to the light source unit 11, and configured todefine a frame rate (e.g., 1/T1), define a plurality of first timeinstants (e.g., t11, t12, t13) within a first time interval (e.g., t1),and set the beam of light provided by the light source unit 11 to aluminance value (e.g., levels L1˜L3) at each of the first time instants(e.g., t11, t12, t13), wherein a length of the first time interval(e.g., t1) is shorter than a reciprocal of the frame rate (e.g., T1),and the luminance values (e.g., levels L1˜L3) are different and within afirst range. The arrangement of the luminance values herein may take theexample in the first embodiment mentioned above.

Similarly, the image sensing unit 15 is electrically connected to thedisplacement calculator 131 (or processing unit 13′), and configured toreceive light reflected from the surface 41S of the button for capturinga first image (e.g., 12 a, 12 b, 12 c in FIG. 1B) of the surface 41S ofthe button by an exposure time length at each of the first time instants(e.g., t11, t12, t13), wherein the exposure time lengths are the same inone embodiment.

The displacement calculator 131 (or processing unit 13′) is also furtherconfigured to calculate an image quality index of each of the firstimages (e.g., 12 a, 12 b, 12 c in FIG. 1B), compare the image qualityindices of each of the first images with at least one quality threshold,and select more than one of the first images as a plurality of firsttemporary images to calculate the rotational displacement of the button(e.g., along an rotate direction in FIG. 4) when the image qualityindices do not meet the at least one quality threshold. The displacementcalculator 131 (or processing unit 13′) also selects an image with agood image quality to represent the first time interval (e.g., t1) forcalculating the rotational displacement when at least a part of theimages have good qualities (e.g., IQ1 within a suitable range).

The operations of the light source unit 11, the displacement calculator131 and the image sensing unit 15 in the third embodiment have beendescribed in the above first and second embodiments (e.g., FIGS. 2A to2C), and thus details thereof are not repeated herein.

In addition to the above operations, the optical processing apparatus 1′further has other operations performed by the press/non-press detector133 described below. More specifically, the optical processing apparatus1′ performs all the operations of the optical processing apparatus 1 ofthe first and second embodiments as well as additional operations.

The press/non-press detector 133 of the processing unit 13′ compares theimage quality index (IQ2) of one of the first images (e.g., captured att11, t12, t13 in FIG. 6) with at least one first press threshold (e.g.,two first press thresholds TH1 and TH2 being shown in FIG. 6) toidentify a pressing state of the button within the first time intervalt1 (or first image capturing period T1), wherein as mentioned above theimage quality index may be one of a feature value and image intensity ofthe images captured within the first time interval t1. In thisembodiment, the one of the first images corresponds to a minimumluminance value (e.g., captured at t11 in FIG. 6) or a maximum luminancevalue (captured at t13 in FIG. 6) of the light source unit 11 among thefirst time instants (e.g., t11, t12, t13 in FIG. 6) as long as theselected one of the first images is close to saturation when the buttonis pressed or not pressed to obtain a maximum button linear distance.

The pressing state identified by the press/non-press detector 133 isclassified into a press state and a non-press state. For example,referring to FIGS. 7A and 7B together, the light source unit 11 providesa beam of light to a surface 41S of the button, and the image sensingunit 15 receives light reflected from the surface 41S and outputs animage corresponding to each of the time instants (e.g., t11, t12, t13 inFIG. 6) within the first time interval t1. Corresponding to differentdistances (e.g., D1 and D2) between the button and the opticalprocessing apparatus 1′, the press/non-press detector 133 is able toidentify the press state and the non-press state according to the imagequality index (e.g., IQ2 in FIG. 6). In the case that the image qualityindex is image intensity of the images captured at each of the timeinstants (e.g., t11, t12, t13 in FIG. 6) within the first time intervalt1, the press/non-press detector 133 identifies lower image intensitywhen the button is pressed (part of lights not impinging on the imagesensing unit 15 as shown in FIG. 7A) and higher image intensity when thebutton is not pressed (most of lights impinging on the image sensingunit 15 as shown in FIG. 7B). For example, when the press/non-pressdetector 133 identifies that the image intensity is lower than a pressthreshold TH2, a press state is confirmed; on the contrary, when thepress/non-press detector 133 identifies that the image intensity ishigher than a press threshold TH1, which is higher than the pressthreshold TH2, a non-press is confirmed.

In the third embodiment, as the optical processing apparatus 1′ is ableto calculate a rotational displacement and a pressing state of a watchcrown 40, the processing unit 1′ is arranged to stop outputting therotational displacement when the image quality index (IQ2) of theselected first image is between the press threshold TH1 and TH2 as shownin FIG. 6. In some cases, when the image quality index (IQ2) of thefirst image is between the press threshold TH1 and TH2, it means thatthe watch crown 40 is on the way being pulled or pushed between twostates and thus the rotation during this transitional period may betaken as undesired movement and ignored.

It is appreciated that the image quality index of the images captured ateach of the time instants is determined according to the arrangement ofthe light source unit 11 and the image sensing unit 15. Accordingly, itis possible that the press/non-press detector 133 identifies lower imageintensity when the button is not pressed (as shown in FIG. 8B) buthigher image intensity when the button is pressed (as shown in FIG. 8A).

Similarly, if the optical processing apparatus 1′ continuous operating,the processing unit 13′ decides a second range corresponding to a secondtime interval (e.g., t2 in FIG. 6) according to a comparison result ofcomparing the image quality indices with the at least one qualitythreshold in the first time interval (e.g., t1 in FIG. 6), defines aplurality of second time instants (e.g., t21, t22, t23 in FIG. 6) withinthe second time interval t2, and sets the beam of light provided by thelight source unit 11 to a luminance value at each of the second timeinstants (e.g., t21, t22, t23), wherein the luminance valuescorresponding to the second time interval t2 are different and withinthe second range. The image sensing unit 15 captures a second image(e.g., 14 a, 14 b, 14 c in FIG. 1B) by the exposure time length at eachof the second time instants (e.g., t21, t22, t23). Details of the aboveoperations have been described in the first and second embodiments andthus are not repeated herein.

In addition to the above operations, the press/non-press detector 133(or the processing unit 13′) calculates an image quality index of eachof the second images (e.g., captured at t21, t22, t23 in FIG. 6), andcompares the image quality index of one of the second images with atleast one second press threshold to identify a pressing state of thebutton within the second time interval t2, wherein the one of the secondimages corresponds to a minimum luminance value (e.g., t21) or a maximumluminance value (e.g., t23) of the light source unit 11 among the secondtime instants (e.g., captured at t21, t22, t23). If the second range isdifferent from the first range, the at least one first press thresholdis different from the at least one second press threshold, wherein thefirst and second press thresholds are previously arranged and storedbefore shipment in a memory device of the optical processing apparatus1′.

In the flow chart of the light source luminance adjustment method shownin FIG. 2A, the step of comparing the image quality index of one of thefirst images with at least one first press threshold to identify apressing state of the button within the first time interval may beinserted after the image quality indices are calculated as shown in FIG.9. It should be mentioned that the pressing state is identified before,concurrently or after the steps S209, S211, S221 and S213 according todifferent applications. Similarly, if the optical processing apparatus1′ continuous operating, the optical processing apparatus 1′ moves to anext frame capturing period (e.g., T2) and performs the steps of:calculating an image quality index of each of the second images (e.g.,captured at t21, t22, t23 in FIG. 6); and comparing the image qualityindex of one of the second images with at least one second pressthreshold to identify the pressing state of the button within the secondtime interval (e.g., t2). More specifically, the press/non-pressdetector 133 identifies a pressing state within every frame capturingperiod (e.g., T1˜T6).

In the above embodiments, the image quality index of the images capturedat each time instances is determined only according to the luminancevalue of the light source unit 11. In other embodiments, it is alsopossible to control the image quality index of the images captured ateach time instances according to an exposure time length and a gainvalue.

Referring to FIG. 6 again, in this embodiment, the processing unit 13′defines successive frame capturing periods (e.g., T1˜T6), defines aplurality of time instants (e.g., t11˜t13, t21˜t23 . . . t61˜t63) withina time interval (e.g., t1, t2 . . . t6) in each frame capturing period,wherein a length of the time interval is shorter than the framecapturing period, and sets the beam of light provided by the lightsource unit 11 to a luminance value (e.g., levels L1˜L3) at each of theplurality of time instants within each time interval. The image sensingunit 15 captures an image of the surface 41S of the button by anexposure time length and a gain value G of a programmable gain amplifier17 at each of the plurality of time instants within the each timeinterval. It should be mentioned that although FIGS. 7A-7B and 8A-8Bshow that the programmable gain amplifier 17 is separated from the imagesensing unit 15, it is only intended to illustrate. In some embodiments,it is possible that the programmable gain amplifier 17 is integrated inthe image sensing unit 15.

In this embodiment, the displacement calculator 131 (or the processingunit 13′) sets an image capture parameter (Im_para), which includes atleast one of the luminance value, the exposure time length and the gainvalue, at each of the plurality of time instants to be different andwithin a predetermined range. The displacement calculator 131 thencalculates an image quality index of each of the images captured (e.g.,at t11˜t13, t21˜t23 . . . t61˜t63) within the each time interval (e.g.,t1˜t6), and calculates the rotational displacement of the button using asecond image among the images captured within the each time interval,wherein the second image is one of the images, among the plurality oftime instants within the each time interval, whose image quality indexmeet at least one quality threshold. In other words, the displacementcalculator 131 performs operations similar to those performed by theprocessing unit 13 in the first and second embodiments above only theluminance value of the light source unit 11 is replaced by the imagecapture parameter (Im_para). More specifically, it is possible to modifythe image quality index by changing the luminance value of the lightsource unit 11, the exposure time length of the image sensing unit 15and/or the gain value of the programmable gain amplifier 17 in thisembodiment. As mentioned above, when all of the images have bad imagequalities, an averaged image of the second images is set as the imagerepresenting one time interval for calculating the rotationaldisplacement.

The press/non-press detector 133 compares the image quality index of afirst image among the images captured within the each time interval withat least one press threshold to identify a pressing state of the buttonwithin the each time interval, wherein the first image corresponds to aminimum image capture parameter (e.g., minimum luminance value, exposuretime length or gain value) or a maximum image capture parameter (e.g.,maximum luminance value, exposure time length or gain value) among theplurality of time instants within the each time interval. Thepress/non-press detector 133 may identify the pressing state in eachFrame or every a predetermined number of Frames.

More specifically, in this embodiment, the first image is associatedwith a same time instant among the plurality of time instants withinevery frame capturing period, e.g., fixed as the first one image or thelast one image captured within every frame capturing period. That is,the position of the first image among the plurality of images withineach time interval is not adaptively changed during operation.

However, the second image is selected according to its image qualityindex (e.g., meeting the at least one quality threshold or not), andthus the second image is possibly associated with different timeinstants among the plurality of time instants within the each timeinterval of two adjacent frame capturing periods. For example referringto FIG. 6 again, the second image is selected as the first one in timeintervals t1 and t2, as the second one in the time interval t3, and asthe third one in time intervals t4 to t6.

As mentioned above, the processing unit 13′ further sets the imagecapture parameter within a different predetermined range when the imagequality indices of the images captured within one of the successiveframe capturing periods do not meet the at least one quality thresholdin order to adjust the image quality of at least one of the imagescaptured within a next frame capturing period to be within a suitablerange. The press threshold and quality threshold may also be changedwhen the image capture parameter is changed.

It is appreciated that a normal state of the button may be a press stateor a non-press state according to different applications. In the presentdisclosure, types and values of the press threshold may or may not beidentical to those of the quality threshold. In the present disclosure,a type of the image quality index to be compared with the pressthreshold (e.g., IQ2 in FIG. 6) may or may not be identical to thatcompared with the quality threshold (e.g., IQ1 in FIG. 6). In thepresent disclosure, the first and second ranges of the luminance valueof the light source unit 11 associated with different Frames may or maynot be identical.

Referring to FIG. 10, it is an application embodiment of an opticalprocessing apparatus 1′ according to another embodiment of the presentdisclosure in which the optical processing apparatus 1′ is adapted todetect a pressing state and a rotational displacement of a watch crown40′. In FIG. 10, the watch crown 40′ is also shown to include a rotaryshaft 41′, a rotary part 43 and a connection part 45 connecting therotary shaft 41′ and the rotary part 43.

In this embodiment, the rotary shaft 41′ has a sheet form (e.g.,thickness much smaller than diameter), and includes at least one throughhole 401 (e.g., 2 through holes being shown in FIG. 10, but not limitedthereto). The thickness of the rotary shaft 41′ is not particularlylimited and is determined according to different applications. Lightemitted by the light source (e.g., light source unit 11) goes throughthe through hole 401 of the rotary shaft 41′ to propagate to a bottomsurface 43S of the rotary part 43. The reflected light beam is capturedby the image sensor (e.g., light sensing unit 15) to output images ofthe bottom surface 43S of the rotary part 43 of the button. Morespecifically, FIG. 10 is different from FIG. 4 only by replacing therotary shaft 41 by a sheet form with at least one through hole 401thereon, and other operations performed by the light source unit 11, thelight sensing unit 15 and the processing unit 13 or 13′ are not changed.Some arrangement of the light source, the image sensor and the buttonare described below.

Referring to FIG. 11, it is a cross sectional view of another embodimentof the present disclosure. In FIG. 11, the rotatable device (e.g., thebutton mentioned above) is shown to have at least one plane, e.g., arotatable plane 107 (e.g., the rotary shaft 41′ shown in FIG. 10). Atleast one through hole 101 (e.g., the through hole 401 shown in FIG. 10)is formed on the rotatable plane 107 to allow light emitted by a lightsource 103 to go through. The emitted light illuminates an object 111(e.g., the rotary part 43 shown in FIG. 10) at the other side of therotatable plane 107 and reflected light is generated. The optical sensor105 detects the reflected light and generates electrical signals Se byoptical sensing. The electrical signals Se are used to indicate whetherthe rotatable plane 107 is rotated to a predetermined position, e.g.,calculated by the processor 13 or 13′ mentioned in the first to thirdembodiments. The rotatable plane 107 rotates by a shaft 109 (e.g., theconnection part 45 shown in FIG. 10). In a non-limiting aspect, at leastone of the rotatable plane 107 and the object 111 is a gear, and theshaft 109 is a gear shaft. The shaft 109 is driven by a motor or by auser to rotate at least one of the rotatable plane 107 and the object111 at a predetermined or changeable rotating speed.

In this aspect, a diameter of the through hole 101 is not a limitation.As long as the light can go through, even a tiny hole is adaptable tothe present disclosure. In order to cause the optical sensor 105 not todetect reflected light when the thorough hole 101 is not aligned withthe light source 103, a space between the rotatable plane 107 and thelight source 103 should be very small, preferably smaller than 0.2 mm toblock the propagation of light therebetween. In this way, if the throughhole 101 does not pass the above space of the light source 103, thereflected light is not detected by the optical sensor 105.

It should be mentioned that said through hole 101 being aligned with thelight source 103 (i.e. rotating to a predetermined position) is notlimited to that the through hole 101 is right above the light source103. According to an emission direction of the light source 103, thethrough hole 101 is arranged to deviate toward the optical sensor 105.More specifically, in the present disclosure, when the rotatable plane107 is rotated to the predetermined position, the at least one throughhole is right above the light source 103, or between upper space of thelight source 103 and the optical sensor 105.

For example, FIG. 11 shows that the optical sensor 105 is arrangedoutside an edge of the rotatable plane 107, and thus the optical sensor105 does not receive reflected light (referred to the light after beingreflected by the object 111) from the object 111 via the at least onethrough hole 101. In an aspect having a larger through hole that exposesa part of the light source 103 and a part of the optical sensor 105, theoptical sensor 105 is arranged under the rotatable plane 107. Thepositional relationship between the light source 103, the optical sensor105 and the object 111 is arranged flexibly as long as the opticalsensor 105 detects light reflected by the object 111.

FIG. 12 is another embodiment of the present disclosure, and adifference thereof from the embodiment of FIG. 11 is that multiplerotatable planes 207 a, 207 b and 207 c (e.g., each as one rotary shaft41′ shown in FIG. 10) are shown in FIG. 12, and at least on through hole(e.g., the through hole 401 shown in FIG. 10) is formed on eachrotatable plane (FIG. 12 showing one through hole on each rotatableplane). In this embodiment, light emitted by the light source 203penetrates the through holes 201 a, 201 b and 201 c when these throughholes are aligned to allow the optical sensor 205 to detect thereflected light. That is, the rotatable planes 207 a, 207 b and 207 care all rotated to a predetermined position and the positioning isaccomplished. In this embodiment, as long as the multiple through holeshave an overlapped area, the light can go through, and this is onebenefit of the optical detection. As the through hole for the lightpenetration does not have the volume limitation, high accuracy is notextremely required in manufacturing these through holes.

Furthermore, the rotatable plane 207 a is the first plane to limit thepropagation of emitted light, and thus the rotatable plane 207 a shouldbe arranged very close to the light source 203 as mentioned in theembodiment of FIG. 11.

In a non-limiting aspect, the rotatable planes 207 a, 207 b and 207 chave different sizes, radiuses and/or rotating speeds. Every apredetermined time interval, the through holes 201 a, 201 b and 201 coverlap once to allow the light emitted by the light source 203 to gothrough every through hole 201 a, 201 b and 201 c to be reflected by theabove object.

In a non-limiting aspect, the optical sensor 205 has a sensing array.When the light emitted by the light source 203 goes through the throughhole 201 a but is unable to pass the through hole 201 b and is reflectedby the rotatable plane 207 b (e.g., a lower surface thereof), a lightspot is formed at a first location of the sensing array. When the lightemitted by the light source 203 goes through the through holes 201 a and201 b but is unable to pass the through hole 201 c and is reflected bythe rotatable plane 207 c (e.g., a lower surface thereof), a light spotis formed at a second location (different from the first location) ofthe sensing array. When the light emitted by the light source 203 goesthrough the through holes 201 a, 201 b and 201 c and is reflected by theabove object, a light spot is formed at a third location (different fromthe first and second locations) of the sensing array. Accordingly, aprocessing unit (e.g., a digital signal processor) identifies positionsof the rotatable planes 207 a, 207 b and 207 c according to a locationof the light spot in the image frame outputted by the sensing array. Inthis embodiment, the light source 203 is preferably a light sourcehaving high directivity.

FIG. 13 is another embodiment of the present disclosure, and adifference thereof from the embodiment of FIG. 11 is that multiplethrough holes 301 a, 301 b and 301 c (e.g., the through hole 401 shownin FIG. 10) arranged with a predetermined relative distance from oneanother are formed at different positions on a same rotatable plane 307(e.g., the rotary shaft 41′ shown in FIG. 10). The space between themultiple through holes is used to locate different positions of therotatable plane 307. For example in this embodiment, the through hole301 b is very close to the through hole 301 c. Accordingly, when therotatable plane 307 is rotating, and if the optical sensor 305successively receives reflected light, which is generated by lightsource 303, having a magnitude larger than a threshold twice (within apredetermined time interval), it means that the rotatable plane 307 isrotated to a position of the through hole 301 b or 301 c depending onthe rotating direction. However, when the rotatable plane 307 isrotating, and if the optical sensor 305 receives reflected light havinga magnitude larger than a threshold once, it means that the rotatableplane 307 is rotated to a position of the through hole 301 a.

FIG. 14 is a cross sectional view of another embodiment of the presentdisclosure, which shows two through holes 401 a and 401 b (e.g., thethrough hole 401 shown in FIG. 10) are formed on one rotatable plane 407(e.g., the rotary shaft 41′ shown in FIG. 10). The first through hole401 a allows the emitted light of the light source 403 to go through toreach the above object 111. The second through hole 401 b allows thereflected light to go through to impinge on the optical sensor 405. Thefirst through hole 401 a and the second through hole 401 b haveidentical or different sizes and/or shapes without particularlimitations as long as when the light source 403 and the optical sensor405 are aligned with the first and second through holes 401 a and 401 brespectively, the emitted light from the light source 403 is reflectedby the object 111 and then received by the optical sensor 405. Asmentioned above, the rotatable plane 407 is very close to the lightsource 403 and the optical sensor 405.

FIG. 15 is a cross sectional view of another embodiment of the presentdisclosure, which shows that a rotatable plane 507 (e.g., the rotaryshaft 41′ shown in FIG. 10) has a single large through hole 501 (e.g.,the through hole 401 shown in FIG. 10) to allow the emitted light of thelight source 503 and the reflected light from the above object 111 to gothrough the same through hole 501. As mentioned above, the rotatableplane 507 is very close to the light source 503 and the optical sensor505.

As mentioned above, according to the spatial arrangement of the lightsource 503, the through hole 501 and the optical sensor 505, the throughhole 501 is located above a part or the whole of the light source 503and the optical sensor 505, or located between upper space of the lightsource 503 and the optical sensor 505 when the rotatable plane 507 isrotated to the predetermined position.

In this embodiment, in order to prevent the emitted light of the lightsource 503 from being directly received by the optical sensor 505,preferably an opaque light blocking wall 504 is disposed between thelight source 503 and the optical sensor 505.

In a non-limiting aspect, the above light sources 103-503 (e.g., thelight source 11 shown in FIG. 10) are light emitting diodes or laserdiodes that emit light of an identifiable spectrum, e.g., infrared lightand/or red light. The optical sensors 105-505 (e.g., the image sensor 15shown in FIG. 10) are CMOS image sensors, photodiodes or other sensorsfor sensing light energy. The light sources 103-503 and optical sensors105-505 are integrated in a control chip with a digital signal processor108 (referring to FIG. 11), and the control chip and the object 111 arearranged at different sides of a rotatable plane, wherein the digitalsignal processor 108 is used to control the light sources 103-503 toemit light and control the optical sensors 105-505 to detect light,which is converted to electrical signals, corresponding to lightemission of the light sources 103-503.

In other words, in the present disclosure the reflection object isarranged at one side of at least one rotatable plane (as shown in FIGS.11-15), and the light source and optical sensor are located at the otherside of the at least one rotatable plane. The light source is used toemit light toward the at least one rotatable plane. When the at leastone rotatable plane is rotated to a predetermined position, emittedlight of the light source goes through at least one through hole toproject on the reflection object. The optical sensor is used to receivereflected light from the reflection object.

In a non-limiting aspect, the digital signal processor identifyingwhether the alignment is fulfilled is to, for example, calculate amagnitude of the electrical signal and compares the calculated amplitudewith a threshold. When the amplitude exceeds the threshold, the throughhole of the rotatable plane 107-507 is identified to be aligned with thelight source and/or the optical sensor which is referred as positioningthe rotatable plane herein. For example, in FIGS. 11 and 12, the digitalsignal processor 108 compares the amplitude of the electrical signalswith a threshold to position the rotatable plane 107, 207 a-207 c. Forexample in FIG. 13, the digital signal processor 108 positions therotatable plane 307 according to a number of times of the amplitudevariation of the electrical signals. As mentioned above, the amplitudeis larger than the threshold for once when the rotation position iscorresponded to the through hole 301 a, and the amplitude is larger thanthe threshold for twice within a predetermined time interval when therotation position is corresponded to the through holes 301 b and 301 c.

In a non-limiting aspect, the digital signal processor 108 furthercontrols the light source 103-503 to turn on and turn off, and controlsthe optical sensor 105-505 to acquire a bright image when the lightsource is turned on and acquire a dark image when the light source isturned off. Then the digital signal processor 108 calculates adifferential image between the bright image and the dark image, andidentifies whether the rotatable plane is rotated to the predeterminedposition according to a comparison result by comparing amplitude of thedifferential image with the threshold to further improve the detectionaccuracy.

In the above embodiments, to specify the light of the light source, afilter is formed on the optical sensor or in the through hole such thatonly the light of a specific wavelength is detectable thereby improvingthe sensing efficiency.

The present disclosure is adaptable to set time of a watch (e.g., asatellite watch or GPS watch). When the watch receives a correct timesignal (e.g., the watch having a communication interface forcommunicating with a station), hour and minute hands of the watch aremoved to correct positions by using the present disclosure to accomplishthe time setting. In addition, the present disclosure is furtheradaptable to an instrument panel using a spinning indicator or setting agear to an original position, e.g., the panel for indicating flow rateand used electricity or the conveyor system for conveying goods byrotating gears.

Referring to FIG. 11 again, for example when the watch, which includesthe optical structure in FIGS. 11-15, receives the correct time signal,the shaft 109 is controlled by a motor (not shown) to rotate therotatable plane 107 to cause the through hole 101 to be aligned with thelight source 103, i.e., controlling the rotatable plane 107 to berotated to a calibration position according to the correct time signal.In some conditions, the rotatable plane 107 is not rotated to a correctcalibration position (i.e. the predetermined position) due to someproblems when the watch receives the correct time signal. In this case,the digital signal processor 108 further identifies whether theamplitude of the electrical signal exceeds the threshold when therotatable plane 107 is rotated to the calibration position in order toidentify whether the calibration position is identical to thepredetermined position or not.

When the amplitude of the electrical signal does not exceed thethreshold, the control chip continuously rotates the rotatable plane 107and counts a time interval to a next time that the through hole 101 isaligned with the light source 103 (e.g., using a counter to count a timeinterval before the amplitude of the electrical signal exceeding thethreshold next time) so as to obtain a deviation angle of the rotatableplane 107. The deviation angle is stored in a memory (also in thecontrol chip) as a calibration amount. In this way, when the watchreceives the correct time signal again, the motor rotates the rotatableplane 107 to the calibration position plus or minus the calibrationamount to cause the through hole 101 of the rotatable plane 107 to becorrectly aligned with the light source 103. The process of storing thecalibration amount is implemented by software and/or hardware codes in acalibration mode, which is entered by pressing a button or via aselection menu by a user.

In a non-limiting aspect, a surface of the rotatable plane 107 facingthe light source 103 and the optical component 105 is covered with lightabsorbing material such that when the through hole 101 is not alignedwith the light source 103, the reflection is reduced to lower the noise.

In a non-limiting aspect, a surface of the object 111 facing the lightsource 103 and the optical sensor 105 is covered with light reflectivematerial (especially for reflecting the emitted light of the lightsource 103) to improve the reflection efficiency.

In a non-limiting aspect, a light reflecting structure (e.g., a mirror)for directing reflected light to a specific direction (e.g., a directionto the optical sensor 105) is arranged on a surface of the object 111facing the light source 103 and the optical sensor 105 to arrange therelative position of the light source 103 and the optical sensor 105according to different requirements.

In a non-limiting aspect, positions of the light source 103 and theoptical sensor 105 in FIG. 11 are exchanged such that the optical sensor105 receives reflected light from the object 111 only when the throughhole 101 is aligned with the optical sensor 105. In this aspect, thelight source 103 emits light continuously, and preferably an uppersurface of the rotatable plane 107 is covered with light absorbingmaterial such that when the through hole 101 is not aligned with theoptical sensor 105, the light emitted by the light source 103 isabsorbed to reduce the interference.

In a non-limiting aspect, the optical structure in FIG. 11 includesmultiple light sources each being associated with a through hole, andeach through hole has a corresponding optical sensor. The digital signalprocessor identifies the rotation position (or rotation angle) accordingto the sensing results of different optical sensors.

It should be mentioned that every non-limiting aspect illustrated aboveusing FIG. 11 as an example is also adaptable to FIGS. 12-15.

In addition, although the rotatable plane mentioned above is describedby a plane, the present disclosure is not so limited. The rotatableplane is a suitable rotatable element (e.g., a gear), a part surface ofwhich is a flat surface formed with other structures protruding orrecessing from the flat surface as long as the structures do notinfluence the rotation thereof.

In one aspect, when the rotary shaft 41′ is very close to the lightsource 11 and the image sensor 15, as mentioned above the image sensor15 is unable to receive reflected light from the bottom surface 43S ofthe rotary part 43 when the light emitted by the light source 11 doesnot penetrate the through hole 401. Accordingly, the processor (e.g.,13) does not calculate the rotational displacement of the button whenthe brightness of the captured image of the image sensor 15 is lowerthan a predetermined threshold. In this case, in order to allow thebutton to be pressed by a user, the rotary part 43 is arranged to beable to change a distance from the rotary shaft 41′, e.g., a structurebeing formed on the connection part 45 (e.g., including two tubes havingdifferent diameters and with or without a spring inside the two tubes)or inside the rotary part 43 (e.g., with or without a spring between therotary part 43 and the connection part 45). When the rotary part 43 ispressed, the distance between the rotary shaft 41′ and opticalprocessing apparatus 1′ is not changed, but only the distance betweenthe rotary shaft 41′ and the rotary part 43 is changed. When the rotarypart 43 is released, the rotary part 43 is recovered to its originalposition by the spring or by pulling the rotary part 43. In this aspect,the processor 13 calculates the rotational displacement and identifiesthe press/non-press using the same process as mentioned in the first tothird embodiments according to the reflected light beam reflected fromthe surface of the rotary part 43 of the button. When the rotary part 43is rotated by a user, the connection part 45 and the rotary shaft 41′ isrotated simultaneously.

In another aspect, the rotary shaft 41′ is not so close to the lightsource 11 and the image sensor 15 such that the processor 13 calculatesthe rotational displacement of the button in both scenarios that thelight emitted by the light source 11 goes through or does not go throughthe through hole 401. In this case, the image sensor 15 preferably has alarge sensing area. For example, when the light emitted by the lightsource 11 goes through the through hole 401, the images captured by theimage sensor 15 has lower brightness; whereas, when the light emitted bythe light source 11 does not go through the through hole 401, the imagescaptured by the image sensor 15 has higher brightness. A brightnessthreshold is previously set such that the processor 13 distinguishes theimages being captured between the above two scenarios. In this aspect,the button is pressed in two ways, one of which is to change thedistance between the rotatory shaft 41′ and the optical processingapparatus 1′, and the other way is to change the distance between therotatory shaft 41′ and the rotatory part 43 as mentioned above. In thisaspect, the processor 13 controls a first operation of an electronicdevice according to first rotational displacement calculated from theimages captured when the light emitted by the light source 11 penetratesthe through hole 401, and controls a second operation of an electronicdevice according to second rotational displacement calculated from theimages captured when the light emitted by the light source 11 does notpenetrate the through hole 401, wherein the first operation and thesecond operation are different operations or the same operation but withdifferent changing degrees, e.g., changing 1 scale corresponding to thefirst rotational displacement and changing multiple scales correspondingto the second rotational displacement, or vice versa. In this aspect,the processor 13 calculates the rotational displacement using the sameprocess as mentioned in the first to third embodiments according to thereflected light beam reflected from the surface of the rotary shaft 41′or the rotary part 43 of the button. In this aspect, the light source 11preferably has a better directivity, e.g., a laser diode.

The above disclosure is related to the detailed technical contents andinventive features thereof. People skilled in this field may proceedwith a variety of modifications and replacements based on thedisclosures and suggestions of the invention as described withoutdeparting from the characteristics thereof. Nevertheless, although suchmodifications and replacements are not fully disclosed in the abovedescriptions, they have substantially been covered in the followingclaims as appended.

What is claimed is:
 1. An optical processing apparatus, comprising: alight source configured to provide a beam of light to go through athrough hole of a rotary shaft to a surface of a rotary part of a buttonto generate a reflected light beam reflected from the surface of therotary part of the button; a processor, electrically connected to thelight source, and configured to define a frame capturing period, definea plurality of first time instants within a first time interval withinthe frame capturing period, and set the beam of light provided by thelight source to a luminance value at each of the first time instants,wherein the luminance values are different corresponding to differentfirst time instants and within a first range; and an image sensor,electrically connected to the processor, and configured to capture thereflected light beam to output a first image of the surface of therotary part of the button by an exposure time length at each of thefirst time instants, wherein the processor is further configured tocalculate an image quality index of each of the first images, comparethe image quality index of one of the first images with at least onefirst press threshold to identify a pressing state of the button withinthe first time interval, compare the image quality indices of each ofthe first images with at least one quality threshold, select more thanone of the first images as a plurality of first temporary images tocalculate a rotational displacement of the button when the image qualityindices do not meet the at least one quality threshold, and whenidentifying that the pressing state of the button is between press andnon-press by comparing the image quality index with the at least onefirst press threshold, take the rotational displacement calculatedbetween the press and the non-press as undesired movement and not outputthe calculated rotational displacement.
 2. The optical processingapparatus of claim 1, wherein the processor is further configured toderive an averaged image by averaging the first temporary images and setthe averaged image as a first selected image representing the first timeinterval.
 3. The optical processing apparatus of claim 1, wherein theprocessor is further configured to decide a second range correspondingto a second time interval within the frame capturing period according toa comparison result of comparing the image quality indices with the atleast one quality threshold, wherein the second time interval occurslater than the first time interval, and the second range is differentfrom the first range, define a plurality of second time instants withinthe second time interval, and set the beam of light provided by thelight source to a luminance value at each of the second time instants,wherein the luminance values are different corresponding to differentsecond time intervals and within the second range, and wherein the imagesensor is further configured to capture the reflected light beam tooutput a second image by the exposure time length at each of the secondtime instants.
 4. The optical processing apparatus of claim 3, whereinthe processor is further configured to calculate an image quality indexof each of the second images, and compare the image quality index of oneof the second images with at least one second press threshold toidentify a pressing state of the button within the second time interval,wherein the one of the second images corresponds to a minimum luminancevalue or a maximum luminance value of the light source among the secondtime instants.
 5. The optical processing apparatus of claim 1, whereineach image quality index is one of a feature value and image intensityof the corresponding first image.
 6. The optical processing apparatus ofclaim 1, wherein the button is a watch crown.
 7. The optical processingapparatus of claim 1, wherein the one of the first images corresponds toa minimum luminance value or a maximum luminance value of the lightsource among the first time instants.
 8. An operating method of anoptical processing apparatus, the optical processing apparatuscomprising a light source, a processor, and an image sensor, the lightsource providing a beam of light to go through a through hole of arotary shaft to a surface of a rotary part of a button to generate areflected light beam reflected from the surface of the rotary part ofthe button, the processor defining a frame capturing period, the imagesensor receiving the reflected light beam, and the operating methodcomprising: defining, by the processor, a plurality of first timeinstants within a first time interval within the frame capturing period;setting, by the processor, the beam of light provided by the lightsource to a luminance value at each of the first time instants, whereinthe luminance values are different corresponding to different first timeinstants and within a first range; capturing, by the image sensor, thereflected light beam to output a first image of the surface of thebutton by an exposure time length at each of the first time instants;calculating, by the processor, an image quality index of each of thefirst images; comparing, by the processor, the image quality index ofone of the first images with at least one first press threshold toidentify a pressing state of the button within the first time interval,comparing, by the processor, the image quality indices of each of thefirst images with at least one quality threshold; selecting, by theprocessor, more than one of the first images as a plurality of firsttemporary images to calculate a rotational displacement of the buttonwhen the image quality indices do not meet the at least one qualitythreshold; and stop outputting the calculated rotational displacementwhen the pressing state of the button is identified between press andnon-press by comparing the image quality index with the at least onefirst press threshold.
 9. The operating method of claim 8, furthercomprising: deriving, by the processor, an averaged image by averagingthe first temporary images; and setting, by the processor, the averagedimage as a first selected image representing the first time interval.10. The operating method of claim 8, further comprising: deciding, bythe processor, a second range corresponding to a second time intervalwithin the frame capturing period according to a comparison result ofcomparing the image quality indices with the at least one qualitythreshold, wherein the second time interval occurs later than the firsttime interval, and the second range is different from the first range;defining, by the processor, a plurality of second time instants withinthe second time interval; setting, by the processor, the beam of lightprovided by the light source to a luminance value at each of the secondtime instants, wherein the luminance values are different correspondingto different second time intervals and within the second range; andcapturing, by the image sensor, the reflected light beam to output asecond image by the exposure time length at each of the second timeinstants.
 11. The operating method of claim 10, further comprising:calculating an image quality index of each of the second images, andcomparing the image quality index of one of the second images with atleast one second press threshold to identify a pressing state of thebutton within the second time interval, wherein the one of the secondimages corresponds to a minimum luminance value or a maximum luminancevalue of the light source among the second time instants.
 12. Theoperating method of claim 8, wherein each image quality index is one ofa feature value and image intensity of the corresponding first image.13. The operating method of claim 8, wherein the one of the first imagescorresponds to a minimum luminance value or a maximum luminance value ofthe light source among the first time instants.
 14. An opticalprocessing apparatus, comprising: a light source configured to provide abeam of light to go through a through hole of a rotary shaft to asurface of a rotary part of a button to generate a reflected light beamreflected from the surface of the rotary part of the button; aprocessor, electrically connected to the light source, and configured todefine successive frame capturing periods, define a plurality of timeinstants within a time interval in each frame capturing period, and setthe beam of light provided by the light source to a luminance value ateach of the plurality of time instants within each time interval; and animage sensor, electrically connected to the processor, and configured tocapture the reflected light beam to output an image of the surface ofthe button by an exposure time length and a gain value at each of theplurality of time instants within the each time interval, wherein theprocessor is further configured to set an image capture parameter, whichincludes at least one of the luminance value, the exposure time lengthand the gain value, at each of the plurality of time instants to bedifferent and within a predetermined range, calculate an image qualityindex of each of the images captured within the each time interval,compare the image quality index of a first image among the imagescaptured within the each time interval with at least one press thresholdto identify a pressing state of the button within the each timeinterval, wherein the first image corresponds to a minimum image captureparameter or a maximum image capture parameter among the plurality oftime instants within the each time interval, calculate a rotationaldisplacement of the button using a second image among the imagescaptured within the each time interval, wherein the second image is oneof the images, among the plurality of time instants within the each timeinterval, whose image quality index meet at least one quality threshold,and stop outputting the calculated rotational displacement when thepressing state of the button is identified between press and non-pressby comparing the image quality index with the at least one pressthreshold.
 15. The optical processing apparatus of claim 14, wherein thebutton is a watch crown.
 16. The optical processing apparatus of claim14, wherein each image quality index is one of a feature value and imageintensity of the corresponding image.
 17. The optical processingapparatus of claim 14, wherein the first image is associated with a sametime instant among the plurality of time instants within every framecapturing period.
 18. The optical processing apparatus of claim 14,wherein the second image is associated with different time instantsamong the plurality of time instants within the each time interval oftwo adjacent frame capturing periods.
 19. The optical processingapparatus of claim 14, wherein the processor is further configured toset the image capture parameter within a different predetermined rangewhen the image quality indices of the images captured within one of thesuccessive frame capturing periods do not meet the at least one qualitythreshold.
 20. The optical processing apparatus of claim 1, wherein thelight source is further configured to provide a beam of light to asurface of the rotary shaft generate a reflected light beam reflectedfrom the surface of the rotary shaft; and the processor is furtherconfigured to calculate another rotational displacement of the buttonaccording to the reflected light beam reflected from the surface of therotary shaft, wherein the rotational displacement and the anotherrotational displacement are configured to control different operationsof an electronic device.